/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gameheartv2;

import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JTextField;

/**
 *
 * @author GaoXteen
 */
public class Main implements WindowListener {

    public int pWidth, pHeight;
    GameStateFrame gsp;
    public JButton greenButton;
    public JButton yellowButton;

    public Main() {

        gsp = new GameStateFrame();
        gsp.setBounds(0, 0, 1024, 738);
        gsp.setVisible(true);

        //gsp.SwitchState(GameDef.STATE_ROOM);
        //gsp.SwitchState(GameDef.STATE_TABLECARD);
        if (gsp.currState == GameDef.STATE_TABLECARD) {
            gsp.setSize(new Dimension(816, 639));
        }
        if (gsp.currState == GameDef.STATE_ROOM) {
            gsp.setSize(new Dimension(1024, 738));

        }

        gsp.addWindowListener(this);

    }

    public static void main(String[] args) {
        new Main();
    }

    //windowlistener
    public void windowActivated(WindowEvent e) {
        gsp.resumeGame();
    }

    public void windowDeactivated(WindowEvent e) {
        gsp.pauseGame();
    }

    public void windowDeiconified(WindowEvent e) {
        gsp.resumeGame();
    }

    public void windowIconified(WindowEvent e) {
        gsp.pauseGame();
    }

    public void windowClosing(WindowEvent e) {
        gsp.stopGame();

    }

    public void windowClosed(WindowEvent e) {
        
    }

    public void windowOpened(WindowEvent e) {
    }
}
